package com.wx.adapter.http.wx.ma.domain.dto;

import lombok.Data;
import org.springframework.util.StringUtils;

import java.util.Objects;

/**
 * wx_back_end
 * <p>
 * success:
 * {
 * "errcode": 0,
 * "errmsg": "ok",
 * "msgid": 2022168646159958011
 * }
 * fail:
 * {
 * "errcode": 43101,
 * "errmsg": "user refuse to accept the msg rid: 6401511c5-16a3011f-17d634b1"
 * }
 *
 * @Auther: cheng.tang
 * @Date: 2023/3/3 11:02 PM
 * @Description:
 */
@Data
public class MaSubscribeSendResultDTO {
    private Long errcode;
    private String errmsg;
    private String msgid;

    /**
     * true 消息发送成功
     * false 失败
     * eg:
     *
     * @return
     */
    public boolean success() {
        return Objects.equals(errcode, 0L) && StringUtils.hasText(msgid);
    }

}
